//管理项目的所有接口

import axios from '../request/request.js'

// 写成函数的形式,调用才会执行,否则所有的请求都执行了
//请求首页数据
export const GetHomeData = () => axios.get("/index/index")

// export const GetHomeData = function(){
//     return axios.get("/index/index")
// }

//请求搜索页数据
export const GetSearchPopupData = () => axios.get("/search/index")

//请求搜索页的提示列表数据(带有参数的写法)
export const GetSearchTipsListData = (params) => axios.get("/search/helper",{params})
// export const GetSearchTipsListData = (obj) => axios.get("/search/helper",{
//     params:obj
// })
// 把obj写成params

//搜索框商品搜索数据
export const GetSearchData = (params) => axios.get("/goods/list",{params})

//清除历史记录
export const ClearHistory = (params) => axios.post("/search/clearhistory",params)

//登录请求
export const UserLogin = (params) => axios.post("/auth/loginByWeb",params)

//获取商品详情信息
export const GetGoodsDetail = (params) => axios.get("/goods/detail",{params})

//获取相关商品
export const GetGoodsRelated = (params) => axios.get("/goods/related",{params})

// 获取购物车商品数量
export const GetCartNum = () => axios.get("/cart/goodscount");

// 添加到购物车请求
export const ToAddCart = (params) => axios.post("/cart/add",params);

// 请求购物车列表数据
export const GetCartData = () => axios.get("/cart/index");

//购物车中，选中和取消选中的请求
export const ChangeGoodsChecked = (params) => axios.post("/cart/checked",params)

//步进器的修改请求
export const SeptNum = (params) => axios.post("/cart/update",params);

//删除商品的请求
export const DelGoods = (params) => axios.post("/cart/delete",params);

// 获取专题商品列表
export const GetTopicList = () => axios.get("/topic/list");

//获取分类页面列表
export const GetCategory= () => axios.get("/catalog/index")

//获取当前分类数据
export const GetCurrentCategory = (params) => axios.get("/catalog/current",{params})


//post写法
// export const GetSearchTipsListData = (params) => axios.post("/search/helper",params)


